<template>
	<view>
		<view class="icon">
			<image mode="widthFix" src="../../static/icon/success.png"></image>
		</view>
		<view class="icon-text">购买成功</view>
		<view class="icon-text-sm">成功支付{{message.total_usdt}}USDT <block v-if="message.total_sid>0">+{{message.total_sid}}SID</block>，购买{{message.buy_amount}}台{{message.name}}</view>
		<view class="button-box">
			<button class="btn btn-primary btn-block" @click="miner(message.id)">查看矿机</button>
			<button class="btn btn-outline btn-block" @click="home()">返回首页</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				message: null,
			}
		},
		onLoad(e) {
			this.message = JSON.parse(e.data);
		},
		methods: {
			miner(id) {
				uni.navigateTo({
					url: "../ucenter/miner/miner-detail?data=&id=" + id
				})
			},
			home() {
				uni.reLaunch({
					url: "../home"
				})
			}
		}
	}
</script>

<style lang="scss">
	.icon {
		text-align: center;

		image {
			width: 120px;
			margin: 0 auto;
		}
	}

	.icon-text {
		font-weight: bold;
		text-align: center;
		font-size: 32px;
		margin-top: 30px;
	}

	.icon-text-sm {
		opacity: .5;
		text-align: center;
		font-weight: bold;
		margin-bottom: 30px;
		padding:0 15px;
		line-height: 120%;
	}

	.button-box {
		padding: 15px;

		button {
			margin-bottom: 15px;
		}
	}
</style>
